/*
 * progmem.h
 *
 *  Created on: Sep 13, 2013
 *      Author: Ken Arok
 */

#ifndef PROGMEM_H_
#define PROGMEM_H_


#if defined(__GNUC__) || defined(__DOXYGEN__)
#include <avr/pgmspace.h>
#define PROGMEM_LOCATION(type, name, loc) type name __attribute__((section (#loc)))
#define PROGMEM_DECLARE(type, name) const type name __attribute__((__progmem__))
#define PROGMEM_STRING(x) PSTR(x)
#define PROGMEM_STRING_T  PGM_P
#define PROGMEM_T const
#define PROGMEM_PTR_T const *
#define PROGMEM_BYTE_ARRAY_T uint8_t*
#define PROGMEM_WORD_ARRAY_T uint16_t*
#define PROGMEM_READ_BYTE(x) pgm_read_byte(x)
#define PROGMEM_READ_WORD(x) pgm_read_word(x)
#endif

#endif /* PROGMEM_H_ */
